import axios from '@/request/request'
/* 导入发送请求的qs格式 */
import qs from 'qs'
/* 精品推荐的数据  */
export const firstApi = () => axios.get('/products/recommend')
export const secondApi = () => axios.get('/products/hot')
export const state1 =(phone) => axios.post ('/sendSMS',qs.stringify(phone))
export const Login1 =(phone) => axios.post ('/phoneRegin',qs.stringify(phone))
// export const WeixinLoginApi = (params) => axios.post('/wechatUsers/PCLogin', qs.stringify(params));
//手机扫码
export const WeixinLoginApi = (params) => axios.post('/wechatUsers/PCLogin', qs.stringify(params));
//手机绑定微信
export const  bingApi= (params) => axios.post('/wechatUsers/binding', qs.stringify(params));
export const userInfo = () => axios.get('/shop/userProfiles');
export const Details = (id) => axios.get(`products/${id}`);
console.log('qs的格式',qs.stringify({a:10,b:20}))
//添加购物车
export const  addShop= (params) => axios.post('/shop/carts/add', qs.stringify(params));
//全部商品  /products
export const allGoods = (params) => axios.get('/products',{params})
//购物车
export const Cart1 = () => axios.get('/shop/carts')
//删除购物车

export const delShop = (id) => axios.delete(`/shop/carts?productIds=${id}`);